import * as vscode from 'vscode';
import * as sidebar from './sidebar';
import textEditor from './textEditor';
import expressServe from './expressServe';

/// 插件激活时
export function activate(context: vscode.ExtensionContext) {
	//注册侧边栏面板的实现
	const sidebarConfig = new sidebar.EntryList();
	vscode.window.registerTreeDataProvider("app_serve_list", sidebarConfig);
	//注册命令 
	vscode.commands.registerCommand("app_serve_list.openChild", args => {
		expressServe.startServe(args);
	});
	context.subscriptions.push(vscode.commands.registerCommand('extension.ConversionAttributes', function () {
		// F1 生成属性
		textEditor._translate(false);
	}));
	context.subscriptions.push(vscode.commands.registerCommand('extension.ConversionAttributesFunc', function () {
		// F2 生成方法
		textEditor._translate(true);
	}));
}